package com.dmc.scrabblator;

import java.io.File;
import java.util.Set;

public class WordManager
{
	WordTrie trie;

	public WordManager()
	{

	}

	public void generate(File f) throws Exception
	{
		trie = new WordTrie();
		try
		{
			trie.generate(f);

		}
		catch (Exception e)
		{
			//Dang!
			e.printStackTrace();
			throw e;
		}
	}

	public Set<WordValue> search(String chars)
	{
		Set<WordValue> strings = trie.getFromList(chars);

		return strings;
	}

}
